package com.dayaokeji.rhythmschoolstudent.client.common.members.adapter

import android.support.v7.widget.AppCompatCheckBox
import android.widget.CheckBox
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.dayaokeji.rhythmschoolstudent.R
import com.dayaokeji.rhythmschoolstudent.client.common.members.SelectMembersActivity
import com.dayaokeji.server_api.domain.Member
import com.dayaokeji.server_api.domain.UserInfo

/**
 *********************************************************************
 **  Created by Zeno on 2018/8/1
 *********************************************************************
 **  version 1.0
 *********************************************************************
 **  Copyright (C) dayaokeji.com 2018 -- 2020 All rights reserved.
 *********************************************************************
 **
 *********************************************************************
 */
class MembersAdapter: BaseQuickAdapter<Member,BaseViewHolder>(R.layout.item_choose_participants,null) {

    override fun convert(helper: BaseViewHolder?, item: Member?) {
        helper?.addOnClickListener(R.id.cb_choose)
        helper?.setText(R.id.tv_name,item?.name)
        helper?.setText(R.id.tv_work_no,item?.workNo)
        val checkBox = helper?.getView<AppCompatCheckBox>(R.id.cb_choose)
        checkBox?.isChecked = SelectMembersActivity.selectMembers.contains(item)
    }
}